import { defineStore } from 'pinia'
import { ref } from 'vue'

export default defineStore('settings', () => {
  let fold = ref(false)
  // 用于监听刷新按钮值变化，进而刷新对应的页面
  let refresh = ref(0)

  function toggleExpand() {
    fold.value = fold.value === true ? false : true
  }

  function refreshed() {
    refresh.value += 1
  }

  return { fold, toggleExpand, refresh, refreshed }
})
